﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace ExportChangesets
{
    public static class Timer
    {
        public static void GetElapsedTime(Action methodToTime)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            methodToTime.Invoke();
            sw.Stop();
            Console.WriteLine(string.Format("Total duration : {0} ms", sw.ElapsedMilliseconds));
            Logger.WriteEntry(string.Format("Total duration : {0} ms", sw.ElapsedMilliseconds));
        }
    }
}